const {http} = require("./http")

function movie(m){
    return http({
        url:`/api/movie?m=${m}`
    })
}

function movieDetail(id){
    return http({
        url:`/api/moiveDetail?id=${id}`
    })
}
function movieSearch(keyword){
    return http({
        url:`/api/search?keyword=${keyword}`
    })
}
function movieCollect({m,id,collected}){
    return http({
        url:`/api/collectMovie/${m}`,
        method:'post',
        data:{
            id,
            collected
        }
    })
}
function addHistory({id,m}){
    return http({
        url:`/api/history/id=${id}&m=${m}`
    })
}
module.exports={
    movie,
    movieDetail,
    movieSearch,
    movieCollect,
    addHistory
}